package com.feiyu.user.feign;

import com.feiyu.user.entity.User;
import com.feiyu.user.entity.UserInfo;
import org.springblade.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author tang ming
 * @since 2021/12/3 11:49
 */
@FeignClient(
        value = "user-service",
        path = "/user"
)
public interface UserFeignClient {

    @GetMapping("/userInfo")
    R<UserInfo> userInfo(@RequestParam("account") String account);

    @PostMapping("/add")
    R newAccount(@RequestBody User user);

    @PostMapping("/update")
    R updateAccount(@RequestBody User user);

    @PostMapping("/delete")
    R deleteAccount(@RequestBody User user);

    @GetMapping("/exist")
    R existAccount(String account);
}
